<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选择技术</title>
    <link rel="stylesheet" href="{{env('STATIC_PATH')}}/css/base.css">
    <link rel="stylesheet" href="{{env('STATIC_PATH')}}/css/user.css">
</head>
<body>
<div class="modal modal-sm">
    <div class="modal-header">
        <h4 class="modal-title">选择技术(审核通过的技术)</h4>
    </div>
    <div class="modal-body">
        <div class="form form-table">
            <div class="form-body">
                <div class="row">
                    <label class="col-2 control-label">技术名称</label>
                    <div class="col-10">
                        <select id="tech_name" class="form-control">
                            @forelse ($dataList as $key=>$value)
                                <option value="{{$value['id']}}" name={{$value['name']}}>{{$value['name']}}</option>
                            @empty
                            @endforelse
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-large btn-warning j_techSave">确定</button>
    </div>
</div>
<script src="{{env('STATIC_PATH')}}/libs/jquery.min.js"></script>
<script src="{{env('STATIC_PATH')}}/libs/datetimepicker.js"></script>
<script src="{{env('STATIC_PATH')}}/js/frame.js"></script>
<script>
    (function ($) {
        $(function () {
            var $m = $('.modal');
            //关闭
            $(".j_closePop").click(function () {
                $('.j_popBg', window.parent.document).fadeOut(200);
                $('.j_popFrame', window.parent.document).fadeOut(200);
            });

            //保存
            $m.find(".j_techSave").click(function () {
                var $tech_name = $("#tech_name");
                var tech_id = $tech_name.val();
                if (!tech_id) {
                    return showErr($tech_name, "请选择技术");
                }
                var $list = $('.j_techList', window.parent.document);
                if($list.find(".row-split[data-id='"+tech_id+"']").length > 0){
                    return showErr($tech_name, "请不要重复选择技术");
                }else{
                    var tech_name = $tech_name.find("option:selected").attr('name');
                    $("#tech_chose_area",window.parent.document).html('<label id="selected_tech" tech-id="'+tech_id+'">'+tech_name+'</label>')
                    //关闭弹框
                    $('.j_popBg', window.parent.document).fadeOut(200);
                    $('.j_popFrame', window.parent.document).fadeOut(200);
                }
            });
        })
    })(jQuery);
</script>
</body>
</html>
